/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package intelligenttm.SourceFile;

import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import me.aviator.entity.myColor;

/**
 *
 * @author 望舒凌霄
 */
public class FenQuALShow {
    private String AttributeString;
    private Rectangle Rect=new Rectangle(60,25,Color.rgb(200, 200, 200));
    private Group G=new Group();
    private myColor MC=new myColor(0,0,200, 200, 200);
    
    public FenQuALShow() {
        Rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
            public void handle(MouseEvent e) {
                MyColorChooser MCC=new MyColorChooser();
                if(MCC.getColor()!=null){
                    MC.setRed(MCC.GetR());
                    MC.setGreen(MCC.GetG());
                    MC.setBlue(MCC.GetB());
                    Rect.setFill(Color.rgb(MCC.GetR(), MCC.GetG(), MCC.GetB(),MCC.GetA()/255));
                }
            }
        });
    }

    public FenQuALShow(String AttributeString) {
        this.AttributeString = AttributeString;
        
        Rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
            public void handle(MouseEvent e) {
                MyColorChooser MCC=new MyColorChooser();
                if(MCC.getColor()!=null){
                    MC.setRed(MCC.GetR());
                    MC.setGreen(MCC.GetG());
                    MC.setBlue(MCC.GetB());
                    Rect.setFill(Color.rgb(MCC.GetR(), MCC.GetG(), MCC.GetB(),MCC.GetA()/255));
                }
            }
        });
    }
    public FenQuALShow(String AttributeString,myColor mc) {
        this.AttributeString = AttributeString;
        MC=mc;
        Rect.setFill(Color.rgb(mc.getRed(), mc.getGreen(), mc.getBlue()));
        Rect.setOnMouseClicked(new EventHandler<MouseEvent>() {
            public void handle(MouseEvent e) {
                MyColorChooser MCC=new MyColorChooser();
                if(MCC.getColor()!=null){
                    MC.setRed(MCC.GetR());
                    MC.setGreen(MCC.GetG());
                    MC.setBlue(MCC.GetB());
                    Rect.setFill(Color.rgb(MCC.GetR(), MCC.GetG(), MCC.GetB(),MCC.GetA()/255));
                }
            }
        });
    }
    
    public void setRectangleFill(myColor mc){
        MC=mc;
        Rect.setFill(Color.rgb(mc.getRed(), mc.getGreen(), mc.getBlue()));
    }
    
    public String getAttributeString() {
        return AttributeString;
    }

    public void setAttributeString(String AttributeString) {
        this.AttributeString = AttributeString;
    }

    public Rectangle getRect() {
        return Rect;
    }

    public void setRect(Rectangle Rect) {
        this.Rect = Rect;
    }

    public Group getGroup() {
        return G;
    }

    public void setGroup(Group G) {
        this.G = G;
    }

    public myColor getMyColor() {
        return MC;
    }

    public void setMyColor(myColor MC) {
        this.MC = MC;
    }
    
}
